package com.javacommunity.model.dao;

import com.javacommunity.model.entity.Answer;
import com.javacommunity.model.entity.User;

public interface AnswerVotationDAO {
	/**
	 *
	 * @param user
	 *            User
	 * @param answer
	 *            Answer
	 * @return true if user voted current answer else return false
	 */
	boolean isVote(User user, Answer answer);

	/**
	 *
	 * @param user
	 *            User
	 * @param answer
	 *            Answer
	 * @return true if voted up successful answer else return false
	 */
	boolean voteUp(User user, Answer answer);

	/**
	 *
	 * @param user
	 *            User
	 * @param answer
	 *            Answer
	 * @return true if voted down successful answer else return false
	 */
	boolean voteDown(User user, Answer answer);

	/**
	 *
	 * @param answer
	 * @return vote up - vote down
	 */
	int countVotation(Answer answer);
}
